<p>This rule raises an issue when built-in Error constructors are called without a message parameter or with an empty string message.</p>
<h2>Why is this an issue?</h2>
<p>Error messages are crucial for debugging and maintaining JavaScript applications. When you create an Error object without a message, you lose
valuable information about what went wrong and where.</p>
<p>Built-in Error objects like <code>Error</code>, <code>TypeError</code>, <code>RangeError</code>, and others are designed to carry descriptive
messages that help developers understand the cause of an issue. Without these messages, debugging becomes much harder, especially in production
environments where stack traces might be the only clue about what happened.</p>
<p>Empty error messages are just as problematic as missing ones. They provide no context about the error condition and force developers to rely solely
on stack traces and surrounding code to understand the issue.</p>
<p>Meaningful error messages serve multiple purposes:</p>
<ul>
  <li> They help during development by clearly explaining what went wrong </li>
  <li> They assist in production debugging when issues occur </li>
  <li> They make code more self-documenting by expressing the expected conditions </li>
  <li> They improve the overall developer experience when working with the codebase </li>
</ul>
<h3>What is the potential impact?</h3>
<p>Without meaningful error messages, debugging becomes significantly more difficult and time-consuming. Developers may struggle to identify the root
cause of issues, leading to longer resolution times and potentially overlooking important problems. In production environments, unclear errors can
make it harder to monitor application health and respond to incidents effectively.</p>
<h3>How to fix?</h3>
<p>Provide a descriptive message when creating Error objects. The message should clearly explain what went wrong or what condition was not met.</p>
<h4>Non-compliant code example</h4>
<pre data-diff-id="1" data-diff-type="noncompliant">
throw new Error(); // Noncompliant
throw new Error(''); // Noncompliant
throw new TypeError(); // Noncompliant
</pre>
<h4>Compliant code example</h4>
<pre data-diff-id="1" data-diff-type="compliant">
throw new Error('Unexpected property found');
throw new Error('Invalid configuration provided');
throw new TypeError('Expected array but received string');
</pre>
<h3>Documentation</h3>
<ul>
  <li> <a href="https://github.com/sindresorhus/eslint-plugin-unicorn#readme">eslint-plugin-unicorn</a> - Rule <a
  href="https://github.com/sindresorhus/eslint-plugin-unicorn/blob/HEAD/docs/rules/error-message.md">error-message</a> </li>
  <li> MDN - Error - <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error">Documentation for JavaScript’s
  built-in Error constructor</a> </li>
  <li> MDN - Error handling - <a
  href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Control_flow_and_error_handling#exception_handling_statements">Guide on error
  handling best practices in JavaScript</a> </li>
</ul>
